﻿<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>垂直居中</title>
<link rel="stylesheet" type="text/css" href="demo.css">
<style type="text/css">
	body{margin:20px;}
	.parent{width:4em;height:500px;}
	.child{width:100%;}
	
	.parent{
		display: table-cell;
		vertical-align: middle;
	}
</style>
</head>
<body>
<div class="parent">
	<div class="child">DEMO</div>
</div>
</body>
</html>